home *** CD-ROM | disk | FTP | other *** search
/ Aminet 40 / Aminet 40 (2000)(Schatztruhe)[!][Dec 2000].iso / Aminet / comm / tcp / Amster.lha / Amster_Install / Install_Amster < prev    next >
Text File  |  2000-07-31  |  6KB  |  272 lines

  1. ; $VER: Install_Amster 0.7a (31.7.2000)
  2.  
  3. (procedure P_check-system-version
  4.     (set #exec-version (/ (getversion) 65536))
  5.     (if (< #exec-version 39)
  6.         (abort "Amster needs Kickstart 3.0 or higher.\n")
  7.     )
  8.  
  9.     (set #mui-version (/ (getversion "LIBS:muimaster.library") 65536))
  10.     (if (< #mui-version 19)
  11.         (abort "Amster needs MUI 3.8+.\n")
  12.     )
  13.  
  14.     (set #nlist-version (/ (getversion "LIBS:MUI/NList.mcc") 65536))
  15.     (if (< #nlist-version 19)
  16.         (abort "Amster needs MCC_NList 19.x+\n")
  17.     )
  18.  
  19.     (set #lamp-version (/ (getversion "LIBS:MUI/Lamp.mcc") 65536))
  20.     (if (< #lamp-version 11)
  21.         (abort "Amster needs MCC_Lamp 11.x+\n")
  22.     )
  23.     (set #os-version (/ (getversion "LIBS:version.library") 65536))
  24. )
  25.  
  26. (procedure P_select-destination-directory
  27.     (if (exists "Work:" (noreq))
  28.         (set @default-dest "Work:")
  29.     (set @default-dest "SYS:")
  30.     )
  31.  
  32.     (set @default-dest
  33.         (askdir
  34.             (prompt "Select the directory where you want to install Amster. A new directory will be created.")
  35.             (help "No help available.")
  36.             (default @default-dest)
  37.         )
  38.     )
  39.     (set @default-dest (tackon @default-dest "Amster/"))
  40. )
  41.  
  42. (procedure P_select-languages
  43.     (set #catalog 19)
  44.     (set #n 0)
  45.     (while (set #thislang (select #n
  46.         "català" "czech" "dansk" "nederlands" "suomi"
  47.         "français" "deutsch" "magyar" "italiano" "norsk" "português"
  48.         "russian" "slovenian" "español" "svenska" "türkçe" ""))
  49.         (
  50.             (if (= @language #thislang) (set #catalog #n))
  51.             (set #n (+ #n 1))
  52.         )
  53.     )
  54.  
  55.     (set #n 0)
  56.     (set #catalogs 1)
  57.     (until (= #n #catalog)
  58.         (set #catalogs (* #catalogs 2))
  59.         (set #n (+ #n 1))
  60.     )
  61.  
  62.     (if (= @user-level 2)
  63.         (set #catalogs
  64.             (askoptions
  65.                 (prompt "Select the languages you want to install.")
  66.                 (help "Checkmark the languages you want to install, and click 'Proceed'.")
  67.                 (choices
  68.                     "Catalan" "Czech" "Danish" "Dutch" "Finnish"
  69.                     "French" "German" "Hungarian" "Italian" "Norwegian" "Portuguese"
  70.                     "Russian" "Slovenian" "Spanish" "Swedish" "Turkish")
  71.                 (default #catalogs)
  72.             )
  73.         )
  74.     )
  75.  
  76.     (if (> #catalogs 0)
  77.         (makedir (tackon @default-dest "Catalogs/"))
  78.     )
  79.  
  80.     (set #n 0)
  81.     (while (set #thislang (select #n
  82.         "català" "czech" "dansk" "nederlands" "suomi"
  83.         "français" "deutsch" "magyar" "italiano" "norsk" "português"
  84.         "russian" "slovensko" "español" "svenska" "türkçe" ""))
  85.         (
  86.             (if (IN #catalogs #n)
  87.                 (copyfiles
  88.                     (source (tackon #source-dir (cat "Catalogs/" #thislang "/Amster.catalog")))
  89.                     (dest (tackon @default-dest (cat "Catalogs/" #thislang)))
  90.                 )
  91.             )
  92.             (set #n (+ #n 1))
  93.         )
  94.     )
  95. )
  96.  
  97. (procedure P_copy-sources
  98.     (if (= @user-level 2)
  99.         (
  100.             (set #copy-source
  101.                 (askchoice
  102.                     (help @askchoice-help)
  103.                     (prompt "Do you want to install sources?")
  104.                     (choices "Yes" "No")
  105.                     (default 1)
  106.                 )
  107.             )
  108.  
  109.             (if (= #copy-source 0)
  110.                 (
  111.                     (set #SourceDir (tackon @default-dest "Source"))
  112.                     (if (not (exists #SourceDir)) (makedir #SourceDir))
  113.                     (copyfiles
  114.                         (source (tackon #source-dir "Source/"))
  115.                         (dest #SourceDir)
  116.                         (all)
  117.                     )
  118.                 )
  119.             )
  120.         )
  121.     )
  122. )
  123.  
  124. (welcome "Welcome to the Amster 0.7a installation.\n")
  125.  
  126. (set @app-name "Amster 0.7a")
  127.  
  128. (P_check-system-version)
  129.  
  130. (complete 0)
  131.  
  132. (set #source-dir (if (= 1 (exists @icon)) (pathonly (expandpath @icon))
  133.     (expandpath @icon))
  134. )
  135.  
  136. (P_select-destination-directory)
  137.  
  138. (complete 10)
  139.  
  140. (makedir @default-dest (infos))
  141.  
  142. (complete 20)
  143.  
  144. (P_select-languages)
  145.  
  146. (complete 30)
  147.  
  148. ; Copy program file and documentation
  149.  
  150. (copyfiles
  151.     (help @copyfiles-help)
  152.     (prompt "Install program and documentation.")
  153.     (confirm)
  154.     (source #source-dir)
  155.     (dest @default-dest)
  156.     (pattern "(README|COPYING|CHANGES|(Amster)(|.guide)(|.servers))")
  157.     (noposition)
  158. )
  159.  
  160. (complete 50)
  161.  
  162. ; Copy ARexx scripts
  163.  
  164. (set #RexxDir (tackon @default-dest "Rexx"))
  165. (if (not (exists #RexxDir)) (makedir #RexxDir))
  166. (copyfiles
  167.     (help @copyfiles-help)
  168.     (prompt "Select the ARexx scripts you want to install.")
  169.     (confirm)
  170.     (source (tackon #source-dir "Rexx/"))
  171.     (dest #RexxDir)
  172.     (all)
  173. )
  174.  
  175. (complete 60)
  176.  
  177. ; Copy icons
  178.  
  179.  
  180. (set #Icons 1)
  181. (if (< #os-version 44)
  182.     (set #Icons 0)
  183. )
  184.  
  185. (if (= @user-level 2)
  186.     (set #Icons
  187.         (askchoice
  188.             (help @askchoice-help)
  189.             (prompt "Which icons do you want to install?")
  190.             (choices "NewIcons" "OS3.5 icons")
  191.             (default #Icons)
  192.         )
  193.     )
  194. )
  195.  
  196. (set #IconSource
  197.     (select #Icons
  198.         "Icons/NewIcons/"
  199.         "Icons/OS3.5/"
  200.     )
  201. )
  202.  
  203. (set #IconDir (tackon @default-dest "Icons"))
  204. (if (not (exists #IconDir)) (makedir #IconDir))
  205.  
  206. (copyfiles
  207.     (help @copyfiles-help)
  208.     (source (tackon #source-dir #IconSource))
  209.     (dest #IconDir)
  210.     (pattern "Amster_(on|off)line.info")
  211. )
  212.  
  213. (copyfiles
  214.     (help @copyfiles-help)
  215.     (source (tackon (tackon #source-dir #IconSource) "Amster.info"))
  216.     (dest @default-dest)
  217. )
  218.  
  219. (complete 65)
  220.  
  221. (if (exists (tackon @default-dest "Amster.guide"))
  222.     (copyfiles
  223.         (help @copyfiles-help)
  224.         (source (tackon (tackon #source-dir #IconSource) "Guide.info"))
  225.         (dest @default-dest)
  226.         (newname "Amster.guide.info")
  227.     )
  228. )
  229.  
  230. (if (exists (tackon @default-dest "README"))
  231.     (copyfiles
  232.         (help @copyfiles-help)
  233.         (source (tackon (tackon #source-dir #IconSource) "Guide.info"))
  234.         (dest @default-dest)
  235.         (newname "README.info")
  236.     )
  237. )
  238.  
  239. (if (exists (tackon @default-dest "COPYING"))
  240.     (copyfiles
  241.         (help @copyfiles-help)
  242.         (source (tackon (tackon #source-dir #IconSource) "Guide.info"))
  243.         (dest @default-dest)
  244.         (newname "COPYING.info")
  245.     )
  246. )
  247.  
  248. (if (exists (tackon @default-dest "CHANGES"))
  249.     (copyfiles
  250.         (help @copyfiles-help)
  251.         (source (tackon (tackon #source-dir #IconSource) "Guide.info"))
  252.         (dest @default-dest)
  253.         (newname "CHANGES.info")
  254.     )
  255. )
  256.  
  257. (complete 70)
  258.  
  259. (P_copy-sources)
  260.  
  261. (complete 90)
  262.  
  263. ; Show README
  264.  
  265. ;(showmedia 'media' "README" 'upper_left' 'medium' 1)
  266.  
  267. (complete 100)
  268.  
  269. (exit "The installation of Amster is finished.")
  270.  
  271. (closemedia media)
  272.